from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time



driver = webdriver.Chrome(service=Service('D:\\myproject\\feng-huang\\1.自动化\\1.selenium\\chromedriver.exe'))
driver.maximize_window()
driver.get('https://www.baidu.com')
driver.find_element(By.LINK_TEXT, '图片').click()
# driver.switch_to.window(driver.window_handles[1])
# driver.close()
driver.switch_to.window(driver.window_handles[0])
driver.switch_to.window(driver.window_handles[1])
time.sleep(50)